#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTextCodec>
#include <QMap>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    QTextCodec* m_codec;
private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

private:
    QString getChineseSpell(QString& src);

    bool In(wchar_t start, wchar_t end, wchar_t code);
    char convert(int n);

    QString FirstLetter(int nCode);

    //bool LessThan(const QString &s1, const QString &s2);

    void init();
    void readJson();


private:
    Ui::MainWindow *ui;

    QString lastString;     //去重复后的首字母

    int count;              //公司个数

    QMap<QString,QStringList> m_map;

    QStringList companyNameList; //公司名称列表

    int count_A = 0;
    int count_B = 0;
    int count_C = 0;
};

#endif // MAINWINDOW_H
